﻿using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace CPPProject.CPP
{
    /// <summary>
    /// 站点、工厂
    /// </summary>
    [Table("CPPPlant")]
    public class CPPPlant : Entity<int>, IHasCreationTime, IMustHaveTenant, IModificationAudited,ICreationAudited
    {
        public int TenantId { get; set; }
        public DateTime CreationTime { get; set; }
        public long? CreatorUserId { get; set; }
        public long? LastModifierUserId { get; set; }
        public DateTime? LastModificationTime { get; set; }
        /// <summary>
        /// 所属公司
        /// </summary>
        public long CompanyId { get; set; }
        [ForeignKey("CompanyId")]
        public virtual CPPCompany TCompany { get; set; }
        /// <summary>
        /// 来源公司
        /// </summary>
        public long? ForCompanyId { get; set; }
        [ForeignKey("ForCompanyId")]
        public virtual CPPCompany TForCompany { get; set; }
        /// <summary>
        /// 站点ID
        /// </summary>
        [MaxLength(50)]
        public string PlantId { get; set; }
        /// <summary>
        /// 站点名称
        /// </summary>
        [MaxLength(50)]
        public string Name { get; set; }
        /// <summary>
        /// 地址
        /// </summary>
        [MaxLength(500)]
        public string Address { get; set; }
        /// <summary>
        /// 经度
        /// </summary>
        [MaxLength(300)]
        public string Longitude { get; set; }
        /// <summary>
        /// 纬度
        /// </summary>
        [MaxLength(300)]
        public string Latitude { get; set; }
        /// <summary>
        /// 客户ID
        /// </summary>
        [MaxLength(300)]
        public string CustomerId { get; set; }
        /// <summary>
        /// 上级站点
        /// </summary>
        public int ParentId { get; set; }
        /// <summary>
        /// 联系人
        /// </summary>
        [MaxLength(50)]
        public string Contactor { get; set; }
        /// <summary>
        /// 联系人2
        /// </summary>
        [MaxLength(50)]
        public string Contactor2 { get; set; }
        /// <summary>
        /// 联系人3
        /// </summary>
        [MaxLength(50)]
        public string Contactor3 { get; set; }
        /// <summary>
        /// 联系电话
        /// </summary>
        [MaxLength(50)]
        public string Telphone { get; set; }
        /// <summary>
        /// 联系电话2
        /// </summary>
        [MaxLength(50)]
        public string Telphone2 { get; set; }
        /// <summary>
        /// 联系电话3
        /// </summary>
        [MaxLength(50)]
        public string Telphone3 { get; set; }
        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsEnabled { get; set; }
        /// <summary>
        /// 最大容量
        /// </summary>
        public decimal MaxCapacity { get; set; }
        /// <summary>
        /// 虚拟站点（1是0否）默认0
        /// </summary>
        public bool IVirtual { get; set; }
        /// <summary>
        /// 类型
        /// </summary>
        [MaxLength(10)]
        public string IType { get; set; }
        /// <summary>
        /// 是否启用库位（1是0否）
        /// </summary>
        public bool IsBin { get; set; }
        /// <summary>
        /// 站点流转权限，流转类型参考CPPCategory
        /// </summary>
        [MaxLength(500)]
        public string TransAttr { get; set; }
    }
}
